Skip to content

2046 - Mulitproduct AAQ CTA URL #6536

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 12, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions kitsune/questions/jinja2/questions/includes/aaq_macros.html
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ <h2 class="card--title has-bottom-margin">
{% set link_detail = aaq_context.product_slug if aaq_context else topic %}
{% set has_support = aaq_context.has_ticketing_support if aaq_context else False %}
{% set has_forum = aaq_context.has_public_forum if aaq_context else False %}
{% set multiple_products = aaq_context.multiple_products if aaq_context else False %}

{% if aaq_context %}
{% if request.user.is_authenticated %}
Expand All @@ -117,9 +118,15 @@ <h2 class="card--title has-bottom-margin">
<p>{{ _('Still need help? Continue to ask your question and get help.') }}</p>
{% endif %}

{% set link_name = "aaq-widget.community-support.kb-article" if not (has_support or has_forum) else "aaq-widget.aaq-step-3" %}
{% set next_step = url('wiki.document', 'get-community-support')|urlparams(exit_aaq=1) if not (has_support or has_forum or topic) else url('questions.aaq_step3', product_slug=aaq_context.product_slug) if aaq_context else url('questions.aaq_step1') %}
{% set link_name = "aaq-widget.community-support.kb-article" if not (has_support or has_forum)
else "aaq-widget.aaq-step-3" %}

{% set next_step = url('wiki.document', 'get-community-support')|urlparams(exit_aaq=1)
if not (has_support or has_forum or topic)
else url('questions.aaq_step3', product_slug=aaq_context.product_slug)
if aaq_context and not multiple_products
else url('questions.aaq_step1') %}

<a class="sumo-button primary-button feature-box"
href="{{ next_step }}"
data-event-name="link_click"
Expand Down
3 changes: 2 additions & 1 deletion kitsune/sumo/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ def has_aaq_config(product=None):
return False


def set_aaq_context(request, product):
def set_aaq_context(request, product, multiple_products=False):
"""Set the AAQ context for a product."""
if not has_aaq_config(product):
request.session["aaq_context"] = {}
Expand All @@ -406,4 +406,5 @@ def set_aaq_context(request, product):
"has_ticketing_support": product.has_ticketing_support,
"product_slug": product.slug,
"has_public_forum": product.questions_enabled(locale=request.LANGUAGE_CODE),
"multiple_products": multiple_products,
}
2 changes: 1 addition & 1 deletion kitsune/wiki/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def maybe_vary_on_accept_language(response):
product = products.first()

# Set the AAQ context for the widget
set_aaq_context(request, product)
set_aaq_context(request, product, multiple_products=True if len(products) > 1 else False)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can just be multiple_products=len(products) > 1.


product_topics = Topic.active.filter(products=product, visible=True)

Expand Down